<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul li{
            list-style: none;
            margin: 0 auto;
            width: 100px;
            height: 100px;
            background-color: red;
        }
        div{
            margin: 0 auto;
            width: 100px;
            height: 100px;
            background-color: blue;
        }
    </style>
</head>
<body>
    <div id="button"></div>
    <div id="button1"></div>
    <ul id="zj"></ul>
</body>
<script>
    var zj = document.querySelector('#zj');
    var btn = document.querySelector('#button');
    var btn1 = document.querySelector('#button1');
    var flag = 1;
    btn.onclick = function(){
        var li = document.createElement('li');
        zj.appendChild(li);
        li.innerHTML = '123';
        btn.onclick = null;
    }
    btn1.onclick = function(){
        var li = document.createElement('li');
        zj.appendChild(li);
        li.innerHTML = '123';
        btn1.onclick = null;
    }
</script>
</html>